<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<input type="checkbox" name="sex" value="-1" title="中性" >中性
		<input type="checkbox" name="sex" value="0" title="男" >男
		<input type="checkbox" name="sex" value="1" title="女" checked >女
		<button type="button" onclick="getRadio()">获取</button>
	</body>
	<script type="text/javascript">
		function getRadio(){
			var rd=document.getElementsByName("sex");
			var str;
			for(var i=0;i<rd.length;i++){
				if(rd[i].checked){
					str+=rd[i].value;
					
				}
			}
			console.log(str);
		}
	</script>
</html>
